UNIT SCREEN;      (*Pure H19 Version - 28 Jun 82*)

INTERFACE

PROCEDURE CLEARSCREEN;
PROCEDURE CLEARSPACE(X,Y,N : INTEGER);
PROCEDURE SAVECURSOR(VAR X,Y : INTEGER);
PROCEDURE NORMALKEYPAD;
PROCEDURE SHIFTKEYPAD;

IMPLEMENTATION

PROCEDURE CLEARSCREEN;
  VAR T : PACKED ARRAY [0..1] OF 0..255;
  BEGIN
    T[0] := 27;
    T[1] := ORD('E');
    UNITWRITE(1,T,2)
  END;

PROCEDURE CLEARSPACE (*X,Y,N : INTEGER*);
  VAR I : INTEGER;
      CS :PACKED ARRAY [1..160] OF 0..255;
  BEGIN
    GOTOXY(X,Y);
    FOR I := 1 TO N DO CS[I] := 32;
    FOR I := N+1 TO N+N DO CS[I] := 8;
    UNITWRITE(1,CS[1],N);
    UNITWRITE(1,CS[N+1],N)
  END;
  
PROCEDURE SAVECURSOR (*VAR X,Y : INTEGER*);
  VAR T : PACKED ARRAY [0..7] OF 0..255;
  BEGIN
    T[0] := 27;
    T[1] := ORD('j');
    T[2] := 27;
    T[3] := ORD('n');
    UNITWRITE(1,T,4);
    UNITREAD(2,T[4],4);
    X := T[7] - 32;
    Y := T[6] - 32
  END;
  
PROCEDURE NORMALKEYPAD;
  VAR T : PACKED ARRAY[0..1] OF 0..255;
  BEGIN
    T[0] := 27;
    T[1] := ORD('u');
    UNITWRITE(1,T,2)
  END;
  
PROCEDURE SHIFTKEYPAD;
  VAR T : PACKED ARRAY[0..1] OF 0..255;
  BEGIN
    T[0] := 27;
    T[1] := ORD('t');
    UNITWRITE(1,T,2)
  END;
  
END.
00>¹¡Bÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ